import React from 'react'
import usePublish from '../../../components/publish-manage/usePublish'
import PublishTable from '../../../components/publish-manage/PublishTable'
import { Button } from 'antd'


// 使用了自定义hooks提取重复代码
export default function Published() {
  const { dataSource, downNews } = usePublish(2)
  return (
    <div>
      <PublishTable dataSource={dataSource} button={(item) => <Button danger onClick={() => downNews(item)}>下线</Button>}></PublishTable>
    </div>
  )
}
